﻿Imports System.Data
Imports VSModel
Imports Cls_Common

Partial Class FrontEnd_Control_GioiThieu
    Inherits System.Web.UI.UserControl
#Region "Sub and Function "
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            ShowData()
        End If
    End Sub
    Protected Sub ShowData()
        Dim data As New VSEntities
        Dim _Lang As Integer = 1
        Dim _MenuId As Integer = ConfigurationManager.AppSettings("IdGioiThieu-Vi")
        If Not Session("LanguageId") Is Nothing Then
            _Lang = Session("LanguageId")
        End If
        If _Lang = 2 Then
            _MenuId = ConfigurationManager.AppSettings("IdGioiThieu-En") 'MenuId tieng anh
        End If
        Dim p As Menu = (From q In data.Menus Where q.MenuId = _MenuId And q.LanguageId = _Lang Select q).SingleOrDefault
        If Not p Is Nothing Then
            ltrDescription.Text = IIf(IsNothing(p.TitlePage) = True, "", p.TitlePage)
        End If
    End Sub
#End Region
End Class
